﻿<UserControl x:Class="Frontend.ClassTypeFilterPanel"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             Name="RootControl">
    <Expander Name="Expander" IsExpanded="False">
        <Expander.Header>
                <CheckBox Name="UseManualFilterCheckbox"
                          IsChecked="{Binding ElementName=RootControl,Path=UseManualFilter}"
                          Checked="UseManualFilterCheckbox_Checked">
                    Class Type Filter
                </CheckBox>
        </Expander.Header>
        <GroupBox>
            <DockPanel>
                <TextBlock DockPanel.Dock="Bottom" HorizontalAlignment="Center" Margin="0, 2, 0, 0">
                    <TextBlock.Inlines>
                        <Hyperlink IsEnabled="{Binding ElementName=UseManualFilterCheckbox, Path=IsChecked}" 
                                   Click="ClearAll_Click">clear all</Hyperlink>
                        <Run> | </Run>
                        <Hyperlink IsEnabled="{Binding ElementName=UseManualFilterCheckbox, Path=IsChecked}"
                                   Click="SelectAll_Click">select all</Hyperlink>
                    </TextBlock.Inlines>
                </TextBlock>
            
                <StackPanel HorizontalAlignment="Center">
                    <StackPanel.Resources>
                        <Style TargetType="CheckBox">
                            <Setter Property="CheckBox.Margin" Value="0 3 0 0" />                        
                            <Setter Property="CheckBox.IsEnabled" 
                                    Value="{Binding ElementName=UseManualFilterCheckbox, Path=IsChecked}" />
                        </Style>
                    </StackPanel.Resources>
                    
                    <CheckBox Name="ClubCheckbox" 
                              IsChecked="{Binding ElementName=RootControl,Path=HighlightClub}">
                        Club
                    </CheckBox>
                    <CheckBox Name="GroupCheckbox"
                              IsChecked="{Binding ElementName=RootControl,Path=HighlightGroup}">
                        Group Class
                    </CheckBox>
                    <CheckBox Name="GrammarCheckbox"
                              IsChecked="{Binding ElementName=RootControl,Path=HighlightGrammar}">
                        Grammar
                    </CheckBox>
                    <CheckBox Name="ReadingCheckbox"
                              IsChecked="{Binding ElementName=RootControl,Path=HighlightReading}">
                        Reading
                    </CheckBox>
                    <CheckBox Name="WritingCheckbox"
                              IsChecked="{Binding ElementName=RootControl,Path=HighlightWriting}">
                        Writing
                    </CheckBox>
                    <CheckBox Name="ConversationCheckbox"
                              IsChecked="{Binding ElementName=RootControl,Path=HighlightConversation}">            
                        Converstation
                    </CheckBox>
                    <CheckBox Name="OtherCheckbox"
                              IsChecked="{Binding ElementName=RootControl,Path=HighlightOther}">
                        Other
                    </CheckBox>
                </StackPanel>
            </DockPanel>
        </GroupBox>
    </Expander>
</UserControl>
